home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / IntlResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  13.4 KB  |  394 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        IntlResources.h
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5+
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1983-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __INTLRESOURCES__
  18. #define __INTLRESOURCES__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23.  
  24.  
  25.  
  26. #if PRAGMA_ONCE
  27. #pragma once
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37.  
  38. #if PRAGMA_STRUCT_ALIGN
  39.     #pragma options align=mac68k
  40. #elif PRAGMA_STRUCT_PACKPUSH
  41.     #pragma pack(push, 2)
  42. #elif PRAGMA_STRUCT_PACK
  43.     #pragma pack(2)
  44. #endif
  45.  
  46.  
  47. enum {
  48.                                                                 /* Bits in the itlcFlags byte */
  49.     itlcShowIcon                = 7,                            /*Show icon even if only one script*/
  50.     itlcDualCaret                = 6,                            /*Use dual caret for mixed direction text*/
  51.                                                                 /* Bits in the itlcSysFlags word */
  52.     itlcSysDirection            = 15                            /*System direction - left to right/right to left*/
  53. };
  54.  
  55.  
  56. enum {
  57.                                                                 /* One more flag in the itlcFlags byte */
  58.     itlcDisableKeyScriptSync    = 3                                /*Disable font and keyboard script synchrinozation*/
  59. };
  60.  
  61.  
  62. enum {
  63.                                                                 /* We should define masks, too. */
  64.     itlcDisableKeyScriptSyncMask = 1 << itlcDisableKeyScriptSync /*Disable font and keyboard script synchrinozation mask*/
  65. };
  66.  
  67.  
  68.  
  69. enum {
  70.     tokLeftQuote                = 1,                            /* NumberParts.data[] enumerators                                             */
  71.     tokRightQuote                = 2,                            /*  In general, these are NOT to be considered indices into the data[] array */
  72.     tokLeadPlacer                = 3,
  73.     tokLeader                    = 4,
  74.     tokNonLeader                = 5,
  75.     tokZeroLead                    = 6,
  76.     tokPercent                    = 7,
  77.     tokPlusSign                    = 8,
  78.     tokMinusSign                = 9,
  79.     tokThousands                = 10,
  80.     tokReserved                    = 11,                            /* 11 is reserved field */
  81.     tokSeparator                = 12,
  82.     tokEscape                    = 13,
  83.     tokDecPoint                    = 14,
  84.     tokEPlus                    = 15,
  85.     tokEMinus                    = 16,
  86.     tokMaxSymbols                = 31,
  87.     curNumberPartsVersion        = 1                                /*current version of NumberParts record*/
  88. };
  89.  
  90.  
  91. enum {
  92.     currSymLead                    = 16,
  93.     currNegSym                    = 32,
  94.     currTrailingZ                = 64,
  95.     currLeadingZ                = 128
  96. };
  97.  
  98.  
  99. enum {
  100.     mdy                            = 0,
  101.     dmy                            = 1,
  102.     ymd                            = 2,
  103.     myd                            = 3,
  104.     dym                            = 4,
  105.     ydm                            = 5
  106. };
  107.  
  108. typedef SInt8                             DateOrders;
  109.  
  110. enum {
  111.     timeCycle24                    = 0,                            /*time sequence 0:00 - 23:59*/
  112.     timeCycleZero                = 1,                            /*time sequence 0:00-11:59, 0:00 - 11:59*/
  113.     timeCycle12                    = 255,                            /*time sequence 12:00 - 11:59, 12:00 - 11:59*/
  114.     zeroCycle                    = 1,                            /*old name for timeCycleZero*/
  115.     longDay                        = 0,                            /*day of the month*/
  116.     longWeek                    = 1,                            /*day of the week*/
  117.     longMonth                    = 2,                            /*month of the year*/
  118.     longYear                    = 3,                            /*year*/
  119.     supDay                        = 1,                            /*suppress day of month*/
  120.     supWeek                        = 2,                            /*suppress day of week*/
  121.     supMonth                    = 4,                            /*suppress month*/
  122.     supYear                        = 8,                            /*suppress year*/
  123.     dayLdingZ                    = 32,
  124.     mntLdingZ                    = 64,
  125.     century                        = 128,
  126.     secLeadingZ                    = 32,
  127.     minLeadingZ                    = 64,
  128.     hrLeadingZ                    = 128
  129. };
  130.  
  131. /* move OffsetTable to QuickdrawText */
  132.  
  133. struct Intl0Rec {
  134.     char                             decimalPt;                    /*decimal point character*/
  135.     char                             thousSep;                    /*thousands separator character*/
  136.     char                             listSep;                    /*list separator character*/
  137.     char                             currSym1;                    /*currency symbol*/
  138.     char                             currSym2;
  139.     char                             currSym3;
  140.     UInt8                             currFmt;                    /*currency format flags*/
  141.     UInt8                             dateOrder;                    /*order of short date elements: mdy, dmy, etc.*/
  142.     UInt8                             shrtDateFmt;                /*format flags for each short date element*/
  143.     char                             dateSep;                    /*date separator character*/
  144.     UInt8                             timeCycle;                    /*specifies time cycle: 0..23, 1..12, or 0..11*/
  145.     UInt8                             timeFmt;                    /*format flags for each time element*/
  146.     char                             mornStr[4];                    /*trailing string for AM if 12-hour cycle*/
  147.     char                             eveStr[4];                    /*trailing string for PM if 12-hour cycle*/
  148.     char                             timeSep;                    /*time separator character*/
  149.     char                             time1Suff;                    /*trailing string for AM if 24-hour cycle*/
  150.     char                             time2Suff;
  151.     char                             time3Suff;
  152.     char                             time4Suff;
  153.     char                             time5Suff;                    /*trailing string for PM if 24-hour cycle*/
  154.     char                             time6Suff;
  155.     char                             time7Suff;
  156.     char                             time8Suff;
  157.     UInt8                             metricSys;                    /*255 if metric, 0 if inches etc.*/
  158.     short                             intl0Vers;                    /*region code (hi byte) and version (lo byte)*/
  159. };
  160. typedef struct Intl0Rec                    Intl0Rec;
  161.  
  162. typedef Intl0Rec *                        Intl0Ptr;
  163. typedef Intl0Ptr *                        Intl0Hndl;
  164.  
  165. struct Intl1Rec {
  166.     Str15                             days[7];                    /*day names*/
  167.     Str15                             months[12];                    /*month names*/
  168.     UInt8                             suppressDay;                /*255 for no day, or flags to suppress any element*/
  169.     UInt8                             lngDateFmt;                    /*order of long date elements*/
  170.     UInt8                             dayLeading0;                /*255 for leading 0 in day number*/
  171.     UInt8                             abbrLen;                    /*length for abbreviating names*/
  172.     char                             st0[4];                        /*separator strings for long date format*/
  173.     char                             st1[4];
  174.     char                             st2[4];
  175.     char                             st3[4];
  176.     char                             st4[4];
  177.     short                             intl1Vers;                    /*region code (hi byte) and version (lo byte)*/
  178.     short                             localRtn[1];                /*now a flag for opt extension*/
  179. };
  180. typedef struct Intl1Rec                    Intl1Rec;
  181.  
  182. typedef Intl1Rec *                        Intl1Ptr;
  183. typedef Intl1Ptr *                        Intl1Hndl;
  184. /*fields for optional itl1 extension*/
  185.  
  186. struct Itl1ExtRec {
  187.     Intl1Rec                         base;                        /*un-extended Intl1Rec*/
  188.     short                             version;
  189.     short                             format;
  190.     short                             calendarCode;                /*calendar code for this itl1 resource*/
  191.     long                             extraDaysTableOffset;        /*offset in itl1 to extra days table*/
  192.     long                             extraDaysTableLength;        /*length of extra days table*/
  193.     long                             extraMonthsTableOffset;        /*offset in itl1 to extra months table*/
  194.     long                             extraMonthsTableLength;        /*length of extra months table*/
  195.     long                             abbrevDaysTableOffset;        /*offset in itl1 to abbrev days table*/
  196.     long                             abbrevDaysTableLength;        /*length of abbrev days table*/
  197.     long                             abbrevMonthsTableOffset;    /*offset in itl1 to abbrev months table*/
  198.     long                             abbrevMonthsTableLength;    /*length of abbrev months table*/
  199.     long                             extraSepsTableOffset;        /*offset in itl1 to extra seps table*/
  200.     long                             extraSepsTableLength;        /*length of extra seps table*/
  201.     short                             tables[1];                    /*now a flag for opt extension*/
  202. };
  203. typedef struct Itl1ExtRec                Itl1ExtRec;
  204.  
  205. struct UntokenTable {
  206.     short                             len;
  207.     short                             lastToken;
  208.     short                             index[256];                    /*index table; last = lastToken*/
  209. };
  210. typedef struct UntokenTable                UntokenTable;
  211. typedef UntokenTable *                    UntokenTablePtr;
  212. typedef UntokenTablePtr *                UntokenTableHandle;
  213.  
  214. union WideChar {
  215.     char                             a[2];                        /*0 is the high order character*/
  216.     short                             b;
  217. };
  218. typedef union WideChar                    WideChar;
  219.  
  220. struct WideCharArr {
  221.     short                             size;
  222.     WideChar                         data[10];
  223. };
  224. typedef struct WideCharArr                WideCharArr;
  225.  
  226. struct NumberParts {
  227.     short                             version;
  228.     WideChar                         data[31];                    /*index by [tokLeftQuote..tokMaxSymbols]*/
  229.     WideCharArr                     pePlus;
  230.     WideCharArr                     peMinus;
  231.     WideCharArr                     peMinusPlus;
  232.     WideCharArr                     altNumTable;
  233.     char                             reserved[20];
  234. };
  235. typedef struct NumberParts                NumberParts;
  236. typedef NumberParts *                    NumberPartsPtr;
  237.  
  238.  
  239. struct Itl4Rec {
  240.     short                             flags;                        /*reserved*/
  241.     long                             resourceType;                /*contains 'itl4'*/
  242.     short                             resourceNum;                /*resource ID*/
  243.     short                             version;                    /*version number*/
  244.     long                             resHeader1;                    /*reserved*/
  245.     long                             resHeader2;                    /*reserved*/
  246.     short                             numTables;                    /*number of tables, one-based*/
  247.     long                             mapOffset;                    /*offset to table that maps byte to token*/
  248.     long                             strOffset;                    /*offset to routine that copies canonical string*/
  249.     long                             fetchOffset;                /*offset to routine that gets next byte of character*/
  250.     long                             unTokenOffset;                /*offset to table that maps token to canonical string*/
  251.     long                             defPartsOffset;                /*offset to default number parts table*/
  252.     long                             resOffset6;                    /*reserved*/
  253.     long                             resOffset7;                    /*reserved*/
  254.     long                             resOffset8;                    /*reserved*/
  255. };
  256. typedef struct Itl4Rec                    Itl4Rec;
  257.  
  258. typedef Itl4Rec *                        Itl4Ptr;
  259. typedef Itl4Ptr *                        Itl4Handle;
  260. /* New NItl4Rec for System 7.0: */
  261.  
  262. struct NItl4Rec {
  263.     short                             flags;                        /*reserved*/
  264.     long                             resourceType;                /*contains 'itl4'*/
  265.     short                             resourceNum;                /*resource ID*/
  266.     short                             version;                    /*version number*/
  267.     short                             format;                        /*format code*/
  268.     short                             resHeader;                    /*reserved*/
  269.     long                             resHeader2;                    /*reserved*/
  270.     short                             numTables;                    /*number of tables, one-based*/
  271.     long                             mapOffset;                    /*offset to table that maps byte to token*/
  272.     long                             strOffset;                    /*offset to routine that copies canonical string*/
  273.     long                             fetchOffset;                /*offset to routine that gets next byte of character*/
  274.     long                             unTokenOffset;                /*offset to table that maps token to canonical string*/
  275.     long                             defPartsOffset;                /*offset to default number parts table*/
  276.     long                             whtSpListOffset;            /*offset to white space code list*/
  277.     long                             resOffset7;                    /*reserved*/
  278.     long                             resOffset8;                    /*reserved*/
  279.     short                             resLength1;                    /*reserved*/
  280.     short                             resLength2;                    /*reserved*/
  281.     short                             resLength3;                    /*reserved*/
  282.     short                             unTokenLength;                /*length of untoken table*/
  283.     short                             defPartsLength;                /*length of default number parts table*/
  284.     short                             whtSpListLength;            /*length of white space code list*/
  285.     short                             resLength7;                    /*reserved*/
  286.     short                             resLength8;                    /*reserved*/
  287. };
  288. typedef struct NItl4Rec                    NItl4Rec;
  289.  
  290. typedef NItl4Rec *                        NItl4Ptr;
  291. typedef NItl4Ptr *                        NItl4Handle;
  292.  
  293.  
  294. struct TableDirectoryRecord {
  295.     OSType                             tableSignature;                /*4 byte long table name */
  296.     unsigned long                     reserved;                    /*Reserved for internal use */
  297.     unsigned long                     tableStartOffset;            /*Table start offset in byte*/
  298.     unsigned long                     tableSize;                    /*Table size in byte*/
  299. };
  300. typedef struct TableDirectoryRecord        TableDirectoryRecord;
  301.  
  302. struct Itl5Record {
  303.     Fixed                             versionNumber;                /*itl5 resource version number */
  304.     unsigned short                     numberOfTables;                /*Number of tables it contains */
  305.     unsigned short                     reserved[3];                /*Reserved for internal use */
  306.     TableDirectoryRecord             tableDirectory[1];            /*Table directory records */
  307. };
  308. typedef struct Itl5Record                Itl5Record;
  309.  
  310. struct RuleBasedTrslRecord {
  311.     short                             sourceType;                    /*Transliterate target type for the LHS of the rule */
  312.     short                             targetType;                    /*Transliterate target type for the RHS of the rule */
  313.     short                             formatNumber;                /*Transliterate resource format number */
  314.     short                             propertyFlag;                /*Transliterate property flags */
  315.     short                             numberOfRules;                /*Number of rules following this field */
  316. };
  317. typedef struct RuleBasedTrslRecord        RuleBasedTrslRecord;
  318.  
  319.  
  320. struct ItlcRecord {
  321.     short                             itlcSystem;                    /*default system script*/
  322.     short                             itlcReserved;                /*reserved*/
  323.     SInt8                             itlcFontForce;                /*default font force flag*/
  324.     SInt8                             itlcIntlForce;                /*default intl force flag*/
  325.     SInt8                             itlcOldKybd;                /*MacPlus intl keybd flag*/
  326.     SInt8                             itlcFlags;                    /*general flags*/
  327.     short                             itlcIconOffset;                /*keyboard icon offset; not used in 7.0*/
  328.     SInt8                             itlcIconSide;                /*keyboard icon side; not used in 7.0*/
  329.     SInt8                             itlcIconRsvd;                /*rsvd for other icon info*/
  330.     short                             itlcRegionCode;                /*preferred verXxx code*/
  331.     short                             itlcSysFlags;                /*flags for setting system globals*/
  332.     SInt8                             itlcReserved4[32];            /*for future use*/
  333. };
  334. typedef struct ItlcRecord                ItlcRecord;
  335.  
  336. struct ItlbRecord {
  337.     short                             itlbNumber;                    /*itl0 id number*/
  338.     short                             itlbDate;                    /*itl1 id number*/
  339.     short                             itlbSort;                    /*itl2 id number*/
  340.     short                             itlbFlags;                    /*Script flags*/
  341.     short                             itlbToken;                    /*itl4 id number*/
  342.     short                             itlbEncoding;                /*itl5 ID # (optional; char encoding)*/
  343.     short                             itlbLang;                    /*current language for script */
  344.     SInt8                             itlbNumRep;                    /*number representation code*/
  345.     SInt8                             itlbDateRep;                /*date representation code */
  346.     short                             itlbKeys;                    /*KCHR id number*/
  347.     short                             itlbIcon;                    /*ID # of SICN or kcs#/kcs4/kcs8 suite.*/
  348. };
  349. typedef struct ItlbRecord                ItlbRecord;
  350. /* New ItlbExtRecord structure for System 7.0 */
  351.  
  352. struct ItlbExtRecord {
  353.     ItlbRecord                         base;                        /*un-extended ItlbRecord*/
  354.     long                             itlbLocalSize;                /*size of script's local record*/
  355.     short                             itlbMonoFond;                /*default monospace FOND ID*/
  356.     short                             itlbMonoSize;                /*default monospace font size*/
  357.     short                             itlbPrefFond;                /*preferred FOND ID*/
  358.     short                             itlbPrefSize;                /*preferred font size*/
  359.     short                             itlbSmallFond;                /*default small FOND ID*/
  360.     short                             itlbSmallSize;                /*default small font size*/
  361.     short                             itlbSysFond;                /*default system FOND ID*/
  362.     short                             itlbSysSize;                /*default system font size*/
  363.     short                             itlbAppFond;                /*default application FOND ID*/
  364.     short                             itlbAppSize;                /*default application font size*/
  365.     short                             itlbHelpFond;                /*default Help Mgr FOND ID*/
  366.     short                             itlbHelpSize;                /*default Help Mgr font size*/
  367.     Style                             itlbValidStyles;            /*set of valid styles for script*/
  368.     Style                             itlbAliasStyle;                /*style (set) to mark aliases*/
  369. };
  370. typedef struct ItlbExtRecord            ItlbExtRecord;
  371.  
  372.  
  373.  
  374. #if PRAGMA_STRUCT_ALIGN
  375.     #pragma options align=reset
  376. #elif PRAGMA_STRUCT_PACKPUSH
  377.     #pragma pack(pop)
  378. #elif PRAGMA_STRUCT_PACK
  379.     #pragma pack()
  380. #endif
  381.  
  382. #ifdef PRAGMA_IMPORT_OFF
  383. #pragma import off
  384. #elif PRAGMA_IMPORT
  385. #pragma import reset
  386. #endif
  387.  
  388. #ifdef __cplusplus
  389. }
  390. #endif
  391.  
  392. #endif /* __INTLRESOURCES__ */
  393.  
  394.